﻿@using Util
@model IterationLife.PlatformBackEnd.AppServices.Dtos.Systems.AttachmentDto
@if (Extensions.IsEmpty(Model.Id))
{
    @("无文件")
}
else
{
    var cache = Model.Address.Split('.');
    var extension = cache[cache.Length - 1];
    switch (extension)
    {
        case "jpg":
        case "png":
        case "jpeg":
        case "gif":
            <div>
                <img onclick="parent.layui_upload_file_preview(this)" src="@Model.Address" width="30px" height="30px" lay-preview-url="@(Model.Address)" />
            </div>
            break;
        case "mp3":
        case "wav":
            <div>
                <img onclick="parent.layui_upload_file_preview(this)" src="/Scripts/Layui/src/images/png/audio-play.png" width="30px" height="30px" lay-preview-url="@(Model.Address)" />
            </div>
            break;
        case "mp4":
        case "avi":
        case "flv":
            <div>
                <img onclick="parent.layui_upload_file_preview(this)" src="/Scripts/Layui/src/images/png/video-play.png" width="30px" height="30px" lay-preview-url="@(Model.Address)" />
            </div>
            break;
        default:
            <a href="javascritp:void(0);" onclick="parent.layui_upload_file_download(this);" lay-download-url="@(Model.Address)">下载</a>
            break;
    }
}